<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@page import="com.framework.entity.Global"%>
<%@ page import="com.biz.utils.ConfigUtil" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
    String resoursUrl = ConfigUtil.get("RESOURCES_URL");
%>
<!DOCTYPE html>
<html class="no-js">
<head>
    <title>签到</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="description" content="">
    <meta name="keywords" content="">
    <meta name="viewport"
          content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <jsp:include page="/jsp/inc_head.jsp"></jsp:include>
    <style>
        .top{
            position:relative;
        }
        .mid{
            background-color:#048fd0;
            padding-top:11px;
            background-image:url(<%=basePath%>/resources/assets/image/pic_signmid.png);
            background-repeat:no-repeat;
            background-size:100%;
            height:33px;
            position:absolute;
            bottom:-15px;
            width:100%;
        }
        .mid_text{
            z-index:1000;
            background-color:#f4cd45;
            width:57%;
            margin:0 auto;
            height:30px;
            line-height:30px;
            text-align:center;
            color:#a73032;
        }
        .bottom{
            padding-top:35px;
            padding-bottom:10px;
            background-image:url(<%=basePath%>/resources/assets/image/bg_signbottom.png);
            background-repeat:no-repeat;
            background-size:100%;
        }
        .zysx{
            margin-top:10px;
            color:#009ee8;
            font-size:15px;
        }
        .sxinfo{
            margin-top:10px;
            text-indent:2em;
            font-size:14px;
        }
        .xfk{
            width: 50%;
            height: 80px;
            background-color: black;
            position: absolute;
            top: 32%;
            left: 50%;
            margin-left: -25%;
            border-radius: 10px;
            color:white;
            text-align: center;
            padding-top: 15px;
            line-height: 25px;
            opacity: 0.9;
            display: none;
        }

        .sign_bottomdiv{
            background-color:#f6f8f7;
            width:90%;
            margin:0 auto;
            margin-bottom:20px;
            border-radius:8px;
            padding-top:8px;
            padding-bottom:8px;
        }
        .sign_infotext{
            text-indent:2rem;
            font-size:14px;
            border-bottom:1px dashed #bcbdbc;
            padding-bottom:10px;
            margin-bottom:10px;
        }
        .sign-top-imgs{
            margin: 10px auto;
            text-align: center;
            position: absolute;
            top: 10px;
            width: 100%;
        }
        .sign-top-imgs img	{
            margin:10px auto;
        }
    </style>
</head>
<body style="background-color:#55afdb;">
<header data-am-widget="header" class="am-header am-header-default"
        style="background-color: #009ee8;">
    <h1 class="am-header-title" style="font-size: 20px;">每日签到</h1>
</header>
<div style="">
    <div class="top">
        <img src="<%=basePath%>/resources/assets/image/bg_signtop.png" width="100%"/>
        <div class="sign-top-imgs">
            <img src="<%=basePath%>/resources/assets/image/pic_signtext.png" width="42%"/>
            <br/>
            <img src="<%=basePath%>/resources/assets/image/pic_signbtn.png" onclick="doSign()" width="38%"/>
        </div>
        <div class="mid">
            <div class="mid_text">
                您已连续签到${signCount}天
            </div>
        </div>
    </div>
    <div class="bottom">
        <div class="am-g sign_bottomdiv">
            <div class="am-u-sm-12">
                <div class="am-u-sm-12 am-text-center" style="color:#009ee8; font-size:15px;">
                    游戏规则
                </div>
                <div class="am-u-sm-12 sign_infotext" style="">
                    打开"久零"微信，每天签到，久零券轻松到手。
                </div>
                <div class="am-u-sm-12" style="font-size:14px; line-height:25px;">
                    <span style="font-size:1px;" class="am-icon-circle"></span>&nbsp;&nbsp;第<span style="color:#009ee8;">1天</span>签到送<span style="color:#009ee8;">1元久零券</span><br/>
                    <span style="font-size:1px;" class="am-icon-circle"></span>&nbsp;&nbsp;第<span style="color:#009ee8;">2天</span>签到送<span style="color:#009ee8;">2元久零券</span><br/>
                    <span style="font-size:1px;" class="am-icon-circle"></span>&nbsp;&nbsp;第<span style="color:#009ee8;">3天</span>签到送<span style="color:#009ee8;">3元久零券</span>，以此类推<br/>
                    <span style="font-size:1px;" class="am-icon-circle"></span>&nbsp;&nbsp;从第<span style="color:#009ee8;">5天</span>开始以后每天签到送<span style="color:#009ee8;">5元久零券</span><br/>
                </div>
                <div class="am-u-sm-12 zysx" >
                    <span class="am-icon-exclamation-circle"></span>&nbsp;注意事项
                </div>
                <div class="am-u-sm-12 sxinfo" >
                    如中途未签到者按第1天开始计算重新签到,连续签到1个月最多可获得150元
                </div>
            </div>
        </div>
    </div>

</div>

<div class="xfk">
    已成功签到<br>
    +10&nbsp;积分
</div>

<script>
    function doSign(){

        $.ajax({
            url: '${pageContext.request.contextPath}/doSign.do',// 跳转到 action
            data: {},
            type: 'post',
            cache: false,
            dataType: 'json',
            success: function (data) {
                if(data.state=='false')
                {
                    alert(data.msg);
                }else if(data.state=='true')
                {
                    alert(data.msg);
                }
                window.location.reload();//刷新当前页面.
            },
            error: function () {
                parent.layer.msg('签到失败！');
            }
        });

    }
</script>
</body>
</html>
